import { COMMDCBOption, DataOpt, RCSDOption, RSDOption, SIDMACOption, SIDOption, TSAOption } from "./DataOption";

export interface ProxyRequestOption {
    index: number;
    proxy_option: ProxyGetRequestListOption | ProxyGetRequestRecordOption | ProxySetRequestListOption
    | ProxySetThenGetRequestListOption | ProxyActionRequestListOption | ProxyActionThenGetRequestListOption
    | ProxyTransCommandRequestOption
}

export interface ProxyGetRequestListOption {
    piid: String;
    timeout_req: number;
    proxyGet: Array<ProxyGet>;
}

export interface ProxyGetRequestRecordOption {
    piid: String;
    timeout_req: number;
    tsa: TSAOption;
    oad: String;
    rsd: RSDOption;
    rcsd: RCSDOption;
}

export interface ProxySetRequestListOption {
    piid: String;
    timeout_req: number;
    proxySet: Array<ProxySet>;
}

export interface ProxySetThenGetRequestListOption {
    piid: String;
    timeout_req: number;
    seqOfProxySetThenGet: Array<ProxySetThenGet>;
}

export interface ProxyActionRequestListOption {
    piid: String;
    timeout_req: number;
    seqOfProxyAction: Array<ProxyAction>;
}

export interface ProxyActionThenGetRequestListOption {
    piid: String;
    timeout_req: number;
    seqOfProxyActionThenGet: Array<ProxyActionThenGet>;
}

export interface ProxyTransCommandRequestOption {
    piid: String;
    oad: String;
    comdcb: COMMDCBOption;
    revFrameTimeout: number;
    revBytesTimeout: number;
    forwardData: String;
}

export interface ProxyGet {
    tsa: TSAOption;
    timeout_srv: number;
    seqOfOad: Array<String>;
}

export interface ProxySet {
    tsa: TSAOption;
    timeout_srv: number;
    seqOfProxyData: Array<ProxySetDataOption>;
}

export interface ProxySetThenGet {
    tsa: TSAOption;
    timeout_srv: number;
    seqOfProxySetThenGetData: Array<ProxySetThenGetDataOption>
}

export interface ProxySetThenGetDataOption {
    soad: String;
    data: DataOpt;
    road: String;
    delayTime: number;
}

export interface ProxySetDataOption {
    oad: String;
    data: DataOpt;
}

export interface ProxyAction {
    tsa: TSAOption;
    timeout_srv: number;
    seqOfProxyActionDataOption: Array<ProxyActionDataOption>;
}

export interface ProxyActionDataOption {
    omd: String;
    data: DataOpt;
}

export interface ProxyActionCipherDataOption {
    omd: String;
    sid?: SIDOption;
    sid_mac?: SIDMACOption;
    paramValue?: String;
}

export interface ProxyActionPlainDataOption {
    data: String;
    dataType: String;
}

export interface ProxyActionThenGet {
    tsa: TSAOption;
    timeout_srv: number;
    seqOfProxyActionThenGetDataOption: Array<ProxyActionThenGetDataOption>;
}

export interface ProxyActionThenGetDataOption {
    omd: String;
    data: DataOpt;
    oad: String;
    delayTime: number;
}
